import React from 'react';
import { useNavigate } from 'react-router-dom';
function Home() {
  const navigate = useNavigate();
  return (
    <div>
      <p>Home</p>
      <button onClick={() => navigate('/counter')}>跳转到/counter</button>
    </div>
  )
}

/* const navigate = () => {
  history.push('/counter');
} */
export default Home;